package cn.anecansaitin.whimsy.client.gui.overlay;

import cn.anecansaitin.whimsy.common.register.ModEffects;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.Style;
import net.neoforged.neoforge.client.gui.overlay.ExtendedGui;
import net.neoforged.neoforge.client.gui.overlay.IGuiOverlay;

public class StunOverlay implements IGuiOverlay {
    private static final Component TEXT = Component.translatable("tooltip.whimsy.stun.overlay").withStyle(Style.EMPTY.withBold(true));

    @Override
    public void render(ExtendedGui gui, GuiGraphics guiGraphics, float partialTick, int screenWidth, int screenHeight) {
        if (!Minecraft.getInstance().player.hasEffect(ModEffects.STUN.get())) {
            return;
        }
        guiGraphics.drawCenteredString(gui.getFont(), TEXT, guiGraphics.guiWidth() / 2, guiGraphics.guiHeight() / 4, 0xFF4500);
    }
}
